﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master" AutoEventWireup="true" CodeFile="Edit.aspx.cs" Inherits="admin_News_Edit" ValidateRequest="false" %>
<%@ MasterType VirtualPath="~/admin/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <!-- iCheck -->
    <link rel="stylesheet" href="<%=ResolveUrl("~/plugins/iCheck/flat/blue.css")%>">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="<%=ResolveUrl("~/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css")%>">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="Server">
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>修改
        <small>新闻内容修改</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="Default.aspx"><i class="fa fa-bullhorn"></i>我的发布</a></li>
                <li>修改</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-3">
                    <a href="Default.aspx" class="btn btn-primary btn-block margin-bottom">我的发布</a>

                    <div class="box box-solid">
                        <div class="box-header with-border">
                            <h3 class="box-title">信息</h3>

                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">

                            <strong><i class="fa fa-user margin-r-5"></i>责编</strong>
                            <br/>
                            <asp:Label ID="Label1" runat="server" Text=<%# Master.ProfileArr[1] %> CssClass="text-muted"></asp:Label>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->

                    <div class="box box-solid">
                        <div class="box-header with-border">
                            <h3 class="box-title">列表</h3>

                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body no-padding">
                            <ul class="nav nav-pills nav-stacked">
                                <li><a href="Default.aspx"><i class="fa fa-inbox"></i>所有发布
                    <span class="label label-primary pull-right">12</span></a></li>
                                <li><a href="Draft.aspx"><i class="fa fa-file-text-o"></i>草稿箱</a></li>
                                <li><a class="cursor" onclick=<%# "openDialog(" + Request["edit"] + ")" %>><i class="fa fa-trash-o"></i>删除</a></li>
                            </ul>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /. box -->
                    
                </div>
                <!-- /.col -->
                <div class="col-md-9">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">编辑文章</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <div class="form-group">
                                <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control" placeholder="标题"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="标题是必须的" ForeColor="#a94442" ControlToValidate="TextBox1"></asp:RequiredFieldValidator>
                            </div>
                            <div class="form-group">
                                <asp:TextBox ID="TextBox2" runat="server" CssClass="form-control" placeholder="来源"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="来源也是必须的" ForeColor="#a94442" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
                            </div>
                            <div class="form-group">
                                <asp:TextBox ID="TextBox3" runat="server" CssClass="form-control" placeholder="新闻内容" TextMode="MultiLine" Rows="12"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="新闻内容更是必须的" ForeColor="#a94442" ControlToValidate="TextBox3"></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <div class="pull-right">
                                <asp:Button ID="Button1" runat="server" CssClass="btn btn-primary" Text="发布" OnClick="Update" />
                            </div>
                            <button type="reset" class="btn btn-default"><i class="fa fa-times"></i>清空内容</button>
                        </div>
                        <!-- /.box-footer -->
                    </div>
                    <!-- /. box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
            <div id="delModal" class="modal fade" role="dialog" aria-labelledby="delTitle" aria-hidden="true">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                            <h4 class="modal-title" id="delTitle">确认删除吗？</h4>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <button type="button" class="btn btn-primary" onclick="confirm()">确认</button>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="Server">
    <!-- iCheck -->
    <script src="<%=ResolveUrl("~/plugins/iCheck/icheck.min.js")%>"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="<%=ResolveUrl("~/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js")%>"></script>
    <script>
        $(function () {
            //Add text editor
            $("#main_TextBox3").wysihtml5();
        });
        var del_id;
        function openDialog(id) {
            del_id = id;
            $('#delModal').modal('show');
        }
        function confirm() {
            if (del_id != null) {
                location.href = "/admin/News/Default.aspx?del_id=" + del_id + "";
            }
        }
    </script>
</asp:Content>

